1. Field of the Invention
The present invention relates to a field device and a fieldbus controller.
2. Description of Related Art
Conventionally, data communication between a control device and a field device such as a measuring instrument and a control valve is performed through a fieldbus in an industrial plant such as a petroleum plant, a petrochemical plant, a chemical plant, and a steel plant. The fieldbus is a digital bidirectional multi-drop communication link between a field device and a control device, and constitutes a local area network in the above described industrial plant.
As shown in FIG. 8, a fieldbus FB connects a control station 204 to field devices 210, 220, and 230 such as control valves and measuring instruments provided at a field site. The control station 204 is connected to information devices 201 to 203 such as work stations (WS) via a communication network N. The information devices 201 to 203 are provided in the central control room, or the like in an industrial plant. Control of valves provided at a field site and a data collection from measuring instruments can be achieved by operating the information devices 201 to 203.
Communication specifications of the above described fieldbus FB include three layers: a physical layer; a data link (DL) layer; and an application layer. This is simpler than the Open Systems Interconnection (OSI) reference model shown in FIG. 9. The second to seventh layers of the OSI reference model (the data link layer and the application layer of the fieldbus model) are occupied by software, and are generally called a communication stack.
The application layer of the fieldbus includes two sublayers: a fieldbus access sublayer (FAS); and a fieldbus message specification layer (FMS). The FAS connects the FMS to the data link layer. The FMS contains user data about measured variables from sensors, such as a positioner control signal, a lower limit signal, a valve opening signal, and an upper limit signal. The user data is used in the user application of a control device or a field device.
Data transmission through the fieldbus will now be described. As shown in FIG. 10, at each layer, layer control information called protocol control information (PCI) and frame check sequence (FCS) using a cyclic redundancy check (CRC) method are added to a protocol data unit (PDU) as an upper layer. The PCI is control information on the PDU, and contains a flag sequence indicating start of the frame and/or end of the frame, an address field indicating transmission destination address, a control field, and the like.
As described above, since the information such as the PCI and FCS is added at each layer, the user data contains more information at a lower layer. At the physical layer that is the lowermost layer and performs data transmission on the fieldbus, data transmission is performed with a preamble, a start delimiter, and an end delimiter being added to the protocol data unit of the data link layer (DL PDU).
Next, a conventional field device connected to the fieldbus FB will be described in detail. As shown in FIG. 11, the field device includes a MAU (media attachment unit) 301, a fieldbus controller 302, a control section 303, a flash ROM 304, a RAM (random access memory) 305, an EEPROM (electrically erasable and programmable read only memory) 306, a synchronization signal generating section 307, and a sensor 308. The control section 303, the fieldbus controller 302, the flash ROM 304, and the RAM 305 are connected to one another through an address bus 309.
The MAU 301 is connected to the fieldbus FB, and shapes a signal waveform when a signal transmission or reception through the fieldbus FB is performed.
As shown in FIG. 12, the fieldbus controller 302 includes an interface section 401, a transmission buffer 411, a transmitting section 412, a FCS generating section 413, an encoder 414, a signal transmitting section 415, a signal receiving section 421, a decoder 422, a receiving section 423, a FCS checking section 424, and a reception buffer 425.
The interface section 401 is connected to the control section 303, and receives a synchronization signal from the synchronization signal generating section 307. The transmission buffer 411 is a buffer that stores data on a FIFO (First In, First Out) basis. The transmission buffer 411 sequentially stores transmission data which is inputted from the control section 303 via the interface section 401. The transmission data stored in the transmission buffer 411 is the protocol data unit of the FAS layer (FAS PDU) shown in FIG. 10.
The transmitting section 412 reads the transmission data stored in the transmission buffer 411, and adds the PCI of the data link layer and the FCS generated in accordance with the CRC method by the FCS generating section 413 to the transmission data. The transmitting section 412 then outputs the transmission data to the encoder 414. The encoder 414 encodes the data outputted from the transmitting section 412 using an encoding method such as Manchester encoding. The signal transmitting section 415 adds a preamble, a start delimiter, an end delimiter, and the like to the data (DL PDU) encoded by the encoder 414, and then outputs the data as a transmission signal to the MAU 301.
In the fieldbus controller 302, the transmission data (FAS PDU) from the control section 303 is temporarily stored in the transmission buffer 411, and a transmission signal (a preamble, a start delimiter, DL PDU, and an end delimiter) based on the transmission data is outputted to the MAU 301 in accordance with an interrupt signal from the control section 303, by means of the transmission buffer 411, the transmitting section 412, the FCS generating section 413, the encoder 414, and the signal transmitting section 415.
Upon receipt of a reception signal received by the MAU 301, the signal receiving section 421 outputs the data (DL PDU) except for the preamble, the start delimiter, and the end delimiter, to the decoder 422. The decoder 422 decodes the data which is received by the signal receiving section 421 and which is coded using the Manchester encoding.
The receiving section 423 removes the PCI and FCS of the data link layer from the data decoded by the decoder 422, and outputs the remaining FAS PDU to the FCS checking section 424. The FCS checking section 424 compares the CRC in the FAS PDU with the FCS contained in the received data to check the validity of the data. The receiving section 423 stores the FAS PDU after the FCS checking by the FCS checking section 424, into the reception buffer 425 as received data, and then outputs an interrupt signal to the control section 303.
In the fieldbus controller 302, the received data (FAS PDU) based on a reception signal (the preamble, the start delimiter, DL PDU, and the end delimiter) from the MAU 301 is temporarily stored in the reception buffer 425, and the interrupt signal is outputted to the control section 303, by means of the signal receiving section 421, the decoder 422, the receiving section 423, the FCS checking section 424, and the reception buffer 425.
As shown in FIG. 11, the control section 303 controls each section of the field device by sequentially reading setting information and control programs stored in the EEPROM 306, and by executing the control programs, using the RAM 305 as a work area.
More specifically, the control section 303 obtains the received data (FAS PDU) stored in the reception buffer 425 of the fieldbus controller 302 as needed, in accordance with the interrupt signal from the fieldbus controller 302. The control section 303 then extracts user data by performing processing based on the PCI (FAS PCI, FMS PCI, etc.), and executes processing based on the user data. Examples of the processing based on the user data include the following processing. If the user data is a command to read a measurement data, the measurement data stored in the RAM 305 is read, and is transmitted to the transmission source of the user data. If the user data is a command to write data into the RAM 305, the data based on the user data is written into the RAM 305.
Moreover, the control section 303 encodes user data to be transmitted to an external device, and adds the layer control information (FMS PCI, FAS PCI) to the encoded user data to create transmission data (FAS PDU). The control section 303 stores the transmission data into the transmission buffer 411 of the fieldbus controller 302, and outputs an interrupt signal for data transmission to the fieldbus controller 302.
The RAM 305 stores setting data of the field device and measurement data of the sensor 308. The synchronization signal generating section 307 is a circuit having a crystal oscillator. The synchronization signal generating section 307 generates a synchronization signal, and outputs the synchronization signal to the control section 303, the fieldbus controller 302, etc. The sensor 308 detects the measured variables, and outputs the measured variables to the control section 303.
As described above, in the conventional field device, the control section 303 performs the processing with respect to the upper layer corresponding to FAS PDU or higher layer, i.e., the application layer. Therefore, if a communication protocol other than a normal communication protocol, such as a communication protocol for safety instrumentation in which processing of the application layer is improved, is used, the firmware of the control section 303 is improved so as to cope with a plurality of communication protocols.
For example, a communication protocol for safety instrumentation is designed to perform additional processing to the normal communication protocol, to calculate a CRC 32 code based on the data of the application layer, and to doubly transmit and receive the data of the application layer including the CRC 32 code.
As a technique for a plurality of communication protocols, Japanese Patent Application Laid-Open No. 2004-120668 discloses a technique for performing transmission and reception by determining a frame of transmission data by the fieldbus controller 302, and selecting an appropriate communication protocol. YAMAHA Corporation, “YTZ 420 Application Manual”, Catalog No.: LSI-6TZ420A0, July, 1995 discloses a conventional fieldbus controller.
In the above described conventional technique, however, some period of time is required to develop new firmware for the control section 303 to cope with a plurality of communication protocols, which cannot be readily achieved. If there is additional processing other than the normal communication protocol, the limited resource of the control section 303 is used to perform the additional processing. As a result, there are possibilities that the communication performance is degraded, and a longer time is required to perform the arithmetic processing to be originally performed, to convert a signal from the sensor, and to execute a function block.